/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.braincasedesigns.roller.parser.model;

/**
 *
 * @author jcampbel
 */
public class Modifier {
    private String operator;
    private int operand;

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Modifier other = (Modifier) obj;
        if (this.operator != other.operator && (this.operator == null || !this.operator.equals(other.operator))) {
            return false;
        }
        if (this.operand != other.operand) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 71 * hash + (this.operator != null ? this.operator.hashCode() : 0);
        hash = 71 * hash + this.operand;
        return hash;
    }

    public int getOperand() {
        return operand;
    }

    public void setOperand(int operand) {
        this.operand = operand;
    }

    public Modifier(){};
    
    public Modifier(String op, int val){
        operator = op;
        operand = val;
    }

    public String getOperator() {
        return operator;
    }

    public void setOperator(String operator) {
        this.operator = operator;
    }
    
    @Override
    public String toString(){
        return "Modifier("+operator+" "+operand+")";
    }
}
